<template>
  <div class="home">
    <Header></Header>
    <Navber></Navber>
    <Swiper :focusList='focusList'></Swiper>
    <Kind :policyDescList='policyDescList' :kingKongList='kingKongList'></Kind>
    <Content :contentList='contentList'></Content>
    <Footer></Footer>
  </div>
</template>

<script>
import Header from './module/header'
import Navber from './module/navber'
import Swiper from './module/swiper'
import Kind from './module/kind'
import Content from './module/content'
import Footer from './module/footer'
// 引入封装好的接口
import url from '@/api/url.js'
export default {
  data () {
    return {
      // 轮播图数据
      focusList: [],
      // 服务数据
      policyDescList: [],
      // 商品类数据
      kingKongList: [],
      // 主要内容数据
      contentList: {}
    }
  },
  created () {
    // 利用挂到vue上的axios请求数据
    this.$http.get(url.getHomeInfo)
      .then((res) => {
        console.log(res)
        this.focusList = res.data.data.focusList
        this.policyDescList = res.data.data.policyDescList
        this.kingKongList = res.data.data.kingKongModule.kingKongList
        this.contentList = res.data.data
      })
  },
  components: {
    Header,
    Navber,
    Swiper,
    Kind,
    Content,
    Footer
  }
}
</script>

<style lang='less' scoped>
.home{
  margin-bottom: 50px;
}
</style>
